﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace Marmat.Common.Http
{
    public class ApiActionDescriptor
    {
        internal ApiActionDescriptor(Type declaringType, MethodInfo member)
        {
            this.DeclaringType = declaringType;
            this.Method = member;
        }

        /// <summary>
        /// 获取实际调用的接口类型。
        /// </summary>
        public Type DeclaringType { get; }

        /// <summary>
        /// 获取关联的方法信息
        /// </summary>
        public MethodInfo Method { get; }

        /// <summary>
        /// 获取Api调用参数值
        /// </summary>
        public object[] Arguments { get; internal set; }

        /// <summary>
        /// 获取管理方法的返回类型。
        /// </summary>
        public Type ReturnType { get => this.Method.ReturnType; }
    }
}
